package org.darkforest.model;

import java.math.BigDecimal;
import java.util.List;

public class Cart {
    private Integer cartId;

    private String buyerId;

    private Integer storeId;

    private String storeName;

    private Integer goodsId;

    private Integer goodsCommonid;

    private String goodsName;

    private BigDecimal goodsPrice;

    private Short goodsNum;

    private String goodsImage;

    private Integer blId;

    private String goodsSerial;         //商品序号 sku
    private Integer goodsStorage;       //商品库存，关联商品表获取
    private String chooseGoodsSpec; //商品规格描述

    private Integer userCoupn;//0 可用 1 不可用


    private Goods goods; //购物车商品信息

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    private List<PBundlingGoods> pBundlingGoodsList;


    private PMansong pMansong;

    public PMansong getpMansong() {
        return pMansong;
    }

    public void setpMansong(PMansong pMansong) {
        this.pMansong = pMansong;
    }

    public List<PBundlingGoods> getpBundlingGoodsList() {
        return pBundlingGoodsList;
    }

    public void setpBundlingGoodsList(List<PBundlingGoods> pBundlingGoodsList) {
        this.pBundlingGoodsList = pBundlingGoodsList;
    }

    public String getChooseGoodsSpec() {
        return chooseGoodsSpec;
    }


    public Integer getGoodsCommonid() {
        return goodsCommonid;
    }

    public void setGoodsCommonid(Integer goodsCommonid) {
        this.goodsCommonid = goodsCommonid;
    }

    public void setChooseGoodsSpec(String chooseGoodsSpec) {
        this.chooseGoodsSpec = chooseGoodsSpec;
    }

    private BigDecimal amount = BigDecimal.ZERO;          //商品总价

    private String selected;             //是否选择，0：未选，1：选中

    private Integer memberId;           //session中存储的用户id，更新购物车buyerId使用

    private String  activeType; //活动类型， ms  xs

    private Integer activeId; //活动ID

    private String goodsClass; //商品分类

    public String getGoodsClass() {
        return goodsClass;
    }

    public void setGoodsClass(String goodsClass) {
        this.goodsClass = goodsClass;
    }

    public String getActiveType() {
        return activeType;
    }

    public void setActiveType(String activeType) {
        this.activeType = activeType;
    }

    public Integer getActiveId() {
        return activeId;
    }

    public void setActiveId(Integer activeId) {
        this.activeId = activeId;
    }

    private List<Cart> cartList;
    public List<Cart> getCartList() {
        return cartList;
    }

    public void setCartList(List<Cart> cartList) {
        this.cartList = cartList;
    }

    public Integer getMemberId() {
        return memberId;
    }

    public void setMemberId(Integer memberId) {
        this.memberId = memberId;
    }

    public String getSelected() {
        return selected;
    }

    public void setSelected(String selected) {
        this.selected = selected;
    }

    public String getGoodsSerial() {
        return goodsSerial;
    }

    public void setGoodsSerial(String goodsSerial) {
        this.goodsSerial = goodsSerial;
    }

    public Integer getCartId() {
        return cartId;
    }

    public void setCartId(Integer cartId) {
        this.cartId = cartId;
    }

    public String getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(String buyerId) {
        this.buyerId = buyerId;
    }

    public Integer getStoreId() {
        return storeId;
    }

    public void setStoreId(Integer storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName == null ? null : storeName.trim();
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName == null ? null : goodsName.trim();
    }

    public BigDecimal getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(BigDecimal goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public Short getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Short goodsNum) {
        this.goodsNum = goodsNum;
    }

    public String getGoodsImage() {
        return goodsImage;
    }

    public void setGoodsImage(String goodsImage) {
        this.goodsImage = goodsImage == null ? null : goodsImage.trim();
    }

    public Integer getBlId() {
        return blId;
    }

    public void setBlId(Integer blId) {
        this.blId = blId;
    }

    public BigDecimal getAmount() {
        BigDecimal amount = new BigDecimal(0);
        if(this.getGoodsPrice()!=null && this.getGoodsNum()!=null){
            amount  = this.getGoodsPrice().multiply(new BigDecimal(this.getGoodsNum()));

        }
        return amount;
    }

    public Integer getGoodsStorage() {
        return goodsStorage;
    }

    public void setGoodsStorage(Integer goodsStorage) {
        this.goodsStorage = goodsStorage;
    }


}